package com.baizhi.action;

import com.baizhi.entity.User;
import com.baizhi.service.UserService;
import com.baizhi.service.UserServiceImpl;
import com.opensymphony.xwork2.ActionSupport;

import java.util.List;

public class UserAction extends ActionSupport {

    private User user;
    private List<User> users;

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public List<User> getUsers() {
        return users;
    }

    public void setUsers(List<User> users) {
        this.users = users;
    }

    public String register() {
        System.out.println("------------------------");
        System.out.println(user);
        UserService userService = new UserServiceImpl();
        userService.register(user);
        return "selectAll";
    }

    public String showAll() {
        System.out.println("+++++++++++++++++++++++");
        UserService userService = new UserServiceImpl();
        users = userService.showAll();
        System.out.println("ppppppppppppppppppp");
        System.out.println("单纯");
        return "showAll";
    }

    public String showAll2() {
        System.out.println("嘻嘻嘻嘻");
        return "showAll";
    }
    public String showAll3() {
        System.out.println("哈哈哈哈哈");
        System.out.println("擦啊哦你吗");
        System.out.println("WQEQEEEEEEEEEEE");
        return "showAll";
    }


}
